//#region echo演示
let txt_echo = document.getElementById('txt_echo');
let btnEcho = document.getElementById('btnEcho');
let preEcho = document.getElementById('preEcho');
btnEcho.addEventListener(`click`, () => {
  ajax.get(
    '/test/echo',
    {
      echo: txt_echo.value,
    },
    (info) => {
      preEcho.innerHTML = JSON.stringify(info, null, 2);
    }
  );
});

//#endregion

//#region post演示
let btnPost = document.getElementById('btnPost');
let prePost = document.getElementById('prePost');

btnPost.addEventListener('click', () => {
  ajax.post(  
    '/test/converter/json',

    {
      lid: 1000,
      logType: '用户登录' + Math.random(),
      logInfo: '用户登录成功',
      lastupdate: '2014-09-01 01:02:03',
    },
    (info) => {
      prePost.innerHTML = JSON.stringify(info, null, 2);
    }
  );
});

//#endregion
